package com.kd.sms.provider.aliyun.model;

import com.aliyun.dysmsapi20170525.models.SendSmsResponseBody;
import com.kd.sms.model.resp.SmsResp;
import com.kd.sms.model.resp.SmsRespData;

public class AliYunSmsResp<T extends SmsRespData> extends SmsResp<T> {

    public AliYunSmsResp(SendSmsResponseBody body, Class<T> clazz) throws InstantiationException, IllegalAccessException {
        T data = clazz.newInstance();
        data.setCode(body.getCode());
        data.setMsg(body.getMessage());
        data.setBizId(body.getBizId());
        data.setRequestId(body.getRequestId());
        this.setSmsRespData(data);
    }
}
